 function isMobile() {
            let userAgentInfo = navigator.userAgent;
            let Agents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod'];
            let getArr = Agents.filter(i => userAgentInfo.includes(i));
            return getArr.length ? true : false;
        }

        // 值改变
        AttachXFormValueChangeEventById("fd_3adf3c39a96cf4", money_1);
        AttachXFormValueChangeEventById("fd_3aee3554a9f32e", money_1);
        AttachXFormValueChangeEventById("fd_3af2317ea0fdee", money_1);
        AttachXFormValueChangeEventById("fd_3af2317ea0fdee", money_1);
        AttachXFormValueChangeEventById("fd_3aee35a87286fe", money_1);
        AttachXFormValueChangeEventById("fd_3aee3721a77284", money_1);
        // 住宿类别
        AttachXFormValueChangeEventById("fd_3b066e6f2f359a", money_1_1);
        // 出差类型
        AttachXFormValueChangeEventById("fd_3b066cdf41c2a0", money_1_2);

        function money_1_2() {
            money_1(function(i) {
                if (!isMobile()) {
                    // 国内外派  money设置为空或0
                    if (document.querySelector('select[name="extendDataFormInfo.value(fd_3b066cdf41c2a0)"]').value == 3) {
                        document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee3554a9f32e)")[0].value = ''

                    }
                    // 国内出差  money还原
                    if (document.querySelector('select[name="extendDataFormInfo.value(fd_3b066cdf41c2a0)"]').value == 1) {
                        document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee3554a9f32e)")[0].value = parseFloat(document.querySelector('xformflag[id="_xform_extendDataFormInfo.value(fd_3adf379fad9e64.' + i + '.fd_3aee3554a9f32e)"]').querySelector('span').innerText)

                    }


                }

                if (isMobile()) {
                    // 国内外派  money设置为空或0
                    if (document.querySelector('#mui_form_Select_0').querySelector('input').value == 3) {
                        document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(11)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value = ''
                    }


                    // 国内出差  money还原
                    if (document.querySelector('#mui_form_Select_0').querySelector('input').value == 1) {
                        document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(11)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value = parseFloat([].slice.call(document.querySelectorAll('.muiSimple.muiDetailTable'), 0, -1)[i].querySelector('tr:nth-of-type(11)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(2)').value)
                    }

                }
            })

        }

        function money_1_1() {
            money_1(function(i) {
                if (!isMobile()) {
                    // document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('tr[trdraggable="true"]')[i].querySelector('td:nth-of-type(18)').querySelector('select').value = ''
                    // 宿舍 money2赋值为空或0
                    if (document.querySelector('xformflag[id="_xform_extendDataFormInfo.value(fd_3b066e6f2f359a)"]').querySelector('select').value == 2) {
                        document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee35a87286fe)")[0].value = ''
                    }
                    // 酒店 money2赋值还原
                    if (document.querySelector('xformflag[id="_xform_extendDataFormInfo.value(fd_3b066e6f2f359a)"]').querySelector('select').value == 1) {
                        document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee35a87286fe)")[0].value = parseFloat(document.querySelector('xformflag[id="_xform_extendDataFormInfo.value(fd_3adf379fad9e64.' + i + '.fd_3aee35a87286fe)"]').querySelector('span').innerText)
                    }
                }

                if (isMobile()) {
                    // document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(18)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value = ''
                    // 宿舍 money2赋值为空或0
                    if (document.querySelector('#mui_form_Select_2').querySelector('input').value == 2) {
                        document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(17)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value = ''

                    }
                    // 酒店 money2赋值还原
                    if (document.querySelector('#mui_form_Select_2').querySelector('input').value == 1) {
                        document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(17)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value = parseFloat([].slice.call(document.querySelectorAll('.muiSimple.muiDetailTable'), 0, -1)[i].querySelector('tr:nth-of-type(17)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(2)').value)
                            //  parseFloat(document.querySelector('#sys_xform_mobile_controls_RelationSelect_5').querySelector('input:nth-of-type(2)').value)

                    }



                }
            })
        }
        // 计算金额
        function money_1(cb) {
            console.log("money_1");
            var zj = 0;
            var zhj = 0;
            var jdhj = 0;
            var hzhj = 0;

            var tableLength = $("#TABLE_DL_fd_3adf379fad9e64  tbody").eq(0).children("tr").length;



            if (!isMobile()) {
                if (tableLength > 3) {
                    // 明细表循环
                    for (let i = 0; i < tableLength - 3; i++) {

                        if (cb && typeof cb === 'function') {
                            cb(i)
                        }

                        var day = document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3adf3c39a96cf4)")[0].value;
                        console.log('day', day)
                        var money = document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee3554a9f32e)")[0].value;
                        console.log('money', money)



                        var money2 = document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee35a87286fe)")[0].value;
                        console.log('money2', money2)
                        var calculation = day * money;
                        console.log('calculation', calculation)


                        var calculation2 = (day - 1) * money2;
                        // var calculation2 = day * money2;
                        console.log('calculation2', calculation2)

                        SetXFormFieldValueById("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b01ad03a666ae)", calculation);
                        SetXFormFieldValueById("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3af2317ea0fdee)", calculation2);

                        zj = Number(zj) + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b01ad03a666ae)")[0].value);
                        console.log('zj', zj)

                        SetXFormFieldValueById("extendDataFormInfo.value(fd_3b03f75f6b1180)", zj);


                        zhj = Number(zhj) + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b01ad03a666ae)")[0].value) +
                            Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee3721a77284)")[0].value) +
                            Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3af2317ea0fdee)")[0].value);
                        console.log('zhj', zhj)

                        hj = Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b01ad03a666ae)")[0].value) +
                            Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee3721a77284)")[0].value) +
                            Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3af2317ea0fdee)")[0].value);
                        console.log('hj', hj)

                        SetXFormFieldValueById("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b040cc660bf2c)", hj);
                        SetXFormFieldValueById("extendDataFormInfo.value(fd_3b03f75f6b1180)", zj);



                        jdhj = Number(jdhj) + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3af2317ea0fdee)")[0].value);
                        SetXFormFieldValueById("extendDataFormInfo.value(fd_3b040de687e464)", jdhj);
                        console.log('jdhj', jdhj)

                        hzhj = Number(hzhj) + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b040cc660bf2c)")[0].value);
                        SetXFormFieldValueById("extendDataFormInfo.value(fd_3b040e12823ce8)", hzhj);
                        console.log('hzhj', hzhj)

                    }
                }
            } else {
                if (tableLength > 2) {

                    // 明细表循环
                    for (let i = 0; i < tableLength - 2; i++) {

                        if (cb && typeof cb === 'function') {
                            cb(i)
                        }
                        console.log("money_1 table1");

                        // var day = document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3adf3c39a96cf4)")[0].value;
                        // var money = document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee3554a9f32e)")[0].value;
                        // var money2 = document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee35a87286fe)")[0].value;

                        var day = document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(8)').querySelector('td:nth-of-type(2)').querySelector('input').value
                        console.log('day', day)
                        var money = document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(11)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value
                        console.log('money', money)
                        var money2 = document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(17)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value
                        console.log('money2', money2)
                        var calculation = day * money;
                        console.log('calculation', calculation)
                        var calculation2 = (day - 1) * money2;
                        // var calculation2 = day * money2;

                        console.log('calculation2', calculation2)


                        // SetXFormFieldValueById("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b01ad03a666ae)", calculation);
                        // SetXFormFieldValueById("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3af2317ea0fdee)", calculation2);

                        document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(12)').querySelector('td:nth-of-type(2)').querySelector('input').value = calculation
                        document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(18)').querySelector('td:nth-of-type(2)').querySelector('input').value = calculation2




                        // zj = Number(zj) + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b01ad03a666ae)")[0].value);
                        zj = Number(zj) + Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(12)').querySelector('td:nth-of-type(2)').querySelector('input').value);
                        console.log('zj', zj)

                        SetXFormFieldValueById("extendDataFormInfo.value(fd_3b03f75f6b1180)", zj);


                        // zhj = Number(zhj) + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b01ad03a666ae)")[0].value)
                        //   + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee3721a77284)")[0].value)
                        //   + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3af2317ea0fdee)")[0].value);
                        // hj = Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b01ad03a666ae)")[0].value)
                        //   + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3aee3721a77284)")[0].value)
                        //   + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3af2317ea0fdee)")[0].value);



                        zhj = Number(zhj) + Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(12)').querySelector('td:nth-of-type(2)').querySelector('input').value) +
                            Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(16)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value) +
                            Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(18)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value);


                        console.log('zhj', zhj)
                        hj = Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(12)').querySelector('td:nth-of-type(2)').querySelector('input').value) +
                            Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(16)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value) +
                            Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(18)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value);

                        console.log('hj', hj)
                            // 合计（人民币）
                            // SetXFormFieldValueById("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b040cc660bf2c)", hj);

                        // SetXFormFieldValueById("extendDataFormInfo.value(fd_3b03f75f6b1180)", zj);


                        document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(19)').querySelector('td:nth-of-type(2)').querySelector('input').value = hj;
                        document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelector('tr[statistic-celltr="true"]:nth-of-type(3)').querySelector('input').value = zj;

                        //      jdhj = Number(jdhj) + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3af2317ea0fdee)")[0].value);
                        jdhj = Number(jdhj) + Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(18)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value);
                        // 350
                        // SetXFormFieldValueById("extendDataFormInfo.value(fd_3b040de687e464)", jdhj);
                        document.querySelector('#mui_form_Input_8').querySelector('input').value = jdhj

                        console.log('jdhj', jdhj)

                        //  hzhj = Number(hzhj) + Number(document.getElementsByName("extendDataFormInfo.value(fd_3adf379fad9e64." + i + ".fd_3b040cc660bf2c)")[0].value);
                        hzhj = Number(hzhj) + Number(document.querySelector('#TABLE_DL_fd_3adf379fad9e64').querySelectorAll('.muiSimple.muiDetailTable')[i].querySelector('tr:nth-of-type(19)').querySelector('td:nth-of-type(2)').querySelector('input:nth-of-type(1)').value);
                        // 461
                        // SetXFormFieldValueById("extendDataFormInfo.value(fd_3b040e12823ce8)", hzhj);
                        document.querySelector('#mui_form_Input_9').querySelector('input').value = hzhj
                        console.log('hzhj', hzhj)
                    }
                }
            }

        }